package com.test;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

public class Dat {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		final Timer timer = new Timer();
		timer.schedule(new TimerTask(){

			@Override
			public void run() {
				System.out.println(new Date());;
				
			}},0, 60000);
		
	 	Calendar c = Calendar.getInstance(); 
	 	c.set(c.get(Calendar.YEAR), c.get(Calendar.MARCH), c.get(Calendar.DATE), c.get(Calendar.HOUR), c.get(Calendar.MINUTE), c.get(Calendar.SECOND));
	 	SimpleDateFormat fo = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
	 	System.out.println(fo.format(new Date()));
	 	System.out.println(fo.format(c.getTime()));

	}

}
